﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Runtime.Serialization;

namespace ServiceDeskInterop
{

    public class ValidationException :FaultException<ValidationFault>
    {
        public ValidationException(string brokenRule)
            : base(new ValidationFault( brokenRule))
        {
            BrokenRule = brokenRule;
        }
        public string BrokenRule { get; private set; }

        // TODO : это лучше зделать Enum в ValidationFault
        public const string MustBeLoggedRule = "MustBeLoggedRule";
        public const string MustBeAdminRule = "MustBeAdminRule";
        public const string MustBeUniqueLoginRule = "MustBeUniqueLoginRule";
        public const string NotEmptyLoginRule = "NotEmptyLoginRule";
        public const string NotEmptyPasswordRule = "NotEmptyPasswordRule";
        public const string MaxPaswordLengthRule = "MaxPaswordLengthRule";
        public const string MaxLoginLengthRule = "MaxLoginLengthRule";
        public const string RoleMustExist = "RoleMustExist";
        public const string AssigneeMustBeOperatorRule = "AssigneeMustBeOperatorRule";
        public const string TaskStateMustExistRule = "TaskStateMustExist";
        public const string OperatorCanOnlyChangeTheirAssignmentsRule = "OperatorCanOnlyChangeTheirAssignmentsRule";
    }
}
